SftTree/OCX 7.0

SftTree.HitTestPix Method

Softel vdm, Inc.

Returns the index of the item found at given coordinates.

Deprecated - Provided for compatibility with earlier versions only - Use Items.HitTestPix instead

Syntax       

VB.NET

ItemIndex = object.HitTestPix(ByVal XPosPix As OLE_XPOS_PIXELS, ByVal YPosPix As OLE_YPOS_PIXELS)  As Integer

VB

ItemIndex = object.HitTestPix(ByVal XPosPix As OLE_XPOS_PIXELS, ByVal YPosPix As OLE_YPOS_PIXELS)  As Long

C#.NET

int ItemIndex = object.HitTestPix(OLE_XPOS_PIXELS XPosPix, OLE_YPOS_PIXELS YPosPix);

VC++

long ItemIndex = object->HitTestPix(OLE_XPOS_PIXELS XPosPix, OLE_YPOS_PIXELS YPosPix);

C

HRESULT object->raw_HitTestPix(OLE_XPOS_PIXELS XPosPix, OLE_YPOS_PIXELS YPosPix, long* ItemIndex);

Delphi

ItemIndex := object.HitTestPix(XPosPix : Integer; YPosPix : Integer)   : Integer;

object

A SftTree object.

XPosPix

The x coordinate to be tested in pixels.

YPosPix

The y coordinate to be tested in pixels.

ItemIndex

Returns the index of the item found at given coordinates.  -1 is returned if no item is found.

Comments

Deprecated - Provided for compatibility with earlier versions only - Use Items.HitTestPix instead

The HitTestPix method returns the index of the item found at given coordinates.

The HitTest and HitTestPix methods are synonyms, but may use different coordinate systems.

If an item is found at the coordinates (xPosPix, yPosPix), the zero-based index of the item is returned.  If the specified coordinates are located in the row/column header or column header area, -1 is returned.  If the coordinates are located in the tree control's client area, below the last item displayed, the zero-based index of the last item + 1 is returned, which is equal to the number of items in the tree control.

The HitTestPix method can be used during a DragOver or OLEDragOver event to determine which item is currently the target of the drag & drop operation.  The CalcCellFromPosPix or CalcIndexFromPosPix methods can also be used.

See Also  SftTree Object | Object Hierarchy


Feedback / comments / error reports for this topic
© 2015 - Softel vdm, Inc. - www.softelvdm.com